package com.a;

import java.util.Scanner;

public class buy {
    public static void main(String[] args) {
        Scanner user=new Scanner(System.in);
        System.out.println("请输入您要出行的月份！");
        int month=user.nextInt();
        System.out.println("请输入您要购买的舱座！");
        String choice=user.next();
        System.out.println("请输入您的机票价格！");
       double money=user.nextDouble();
        favora(month,choice,money);

    }
    public static void favora(int month,String choice,double money){


        if (month>=5&&month<=10)
        {

            switch(choice)
            {
                case "经济舱":
                    money*=(0.85);
                    System.out.println("当前"+month+"月份为旺季,您选择的经济舱机票优惠价格为"+money+"元");
                    break;
                case "头等舱":
                    money*=(0.9);
                    System.out.println("当前"+month+"月份为旺季,您选择的头等舱机票优惠价格为"+money+"元");
                    break;

            }

        }
        else
        {

            switch(choice)
            {
                case "经济舱":
                    money*=(0.65);
                    System.out.println("当前"+month+"月份为淡季,您选择的经济舱机票优惠价格为"+money+"元");

                    break;
                case "头等舱":
                    money*=(0.7);
                    System.out.println("当前"+month+"月份为淡季,您选择的头等舱机票优惠价格为"+money+"元");
                    break;

            }

            }
        }
    }


